<template>
	<!-- 要写小程序的标签 -->
	<view>
<<<<<<< HEAD
		<!-- <button @click="toA">去a页面</button> -->
		<u-search v-model="searchVal" :placeholder="placeholder || '请输入关键词'" :show-action="false" :disabled="true"
			margin="20rpx 24rpx" clearabled @click="onClick">
		</u-search>
<<<<<<< HEAD
		<!-- <view class="box" :id="id" @click="onClick">{{msg}}</view> -->
		<!-- <text>text标签里面放文字就好</text> -->
=======

		<!-- 	<view class="box" :id="id" @click="onClick">{{msg}}</view>
		<text>text标签里面放文字就好</text> -->
>>>>>>> f3624e4f2fcf8612380565a3ad79c1665eda2cde
=======
>>>>>>> e7bb3bf1d2aecfb5c269bc2293e70340a5828fb9

		<view class="good">
			<h4>{{name}}</h4>
			<goodlist :curr="brotherCategory"></goodlist>
		</view>

<<<<<<< HEAD
		<!-- easycom模式 components文件夹下，文件目录和.vue文件名字相同，可以直接使用 -->
<<<<<<< HEAD
		<!-- <child></child> -->
<<<<<<< HEAD

		<!-- <view class="bottom">bottom</view> -->


		<view class="center">

			<view class="center_word">品牌制造商提供</view>
			<view class="brand_body">
				<view class="brand_manufacturers" v-for="item in brandList">
					<view class="brand_manufacturers_word">
						{{item.name}}

					</view>
					<view class="brand_manufacturers_price">
						￥ {{item.floor_price.toFixed(2)}}元
					</view>
					<view class="brand_manufacturers_img">
						<image :src="item.list_pic_url" mode=""></image>
					</view>
				</view>
			</view>
		</view>
=======

		<!-- <view class="bottom">bottom</view> -->




		<view class="newgoodslist">
			<view class="now">周一周四.新品首发</view>

			<view class="new">
				<view class="new-in" v-for="item in newGoodList">
					<view class="ccc">
						<image class="img" :src="item.list_pic_url" mode="widthFix"></image>
					</view>
					<view class="name">{{item.name}}</view>
					<view class="price">￥{{item.retail_price}}.00元</view>
				</view>
			</view>
		</view>


		<view class="hotGoodList">
			<view class="hot">人气推荐</view>
			<view class="hotGoodList-a" v-for="item in hotGoodsList">
				<image class="img" :src="item.list_pic_url" mode="widthFix"></image>
				<view class="bb">
					<view>{{item.name}}</view>
					<view>{{item.goods_brief}}</view>
					<view>￥{{item.retail_price}}.00元</view>
				</view>
			</view>
		</view>
	</view>


>>>>>>> f3624e4f2fcf8612380565a3ad79c1665eda2cde
=======

>>>>>>> e7bb3bf1d2aecfb5c269bc2293e70340a5828fb9
=======

		<!-- 轮播图 -->
		<child></child>
		<view class="wrap">
			<u-swiper :list="list" name="image_url" height="450" img-mode="heightFix"></u-swiper>
		</view>
		<!-- 轮播图下面导航栏 -->
		<<!-- view class="navBar">
			<u-grid-item v-for="item in navbarList" :key="item.id">
				<u-image width="60rpx" height="60rpx" :src="item.icon_url
"></u-image>
				<view class="grid-text">{{item.name}}</view>
			</u-grid-item>
	</view> -->

	<view class="bottom">bottom</view>
>>>>>>> 399ef1c19967973891445c633fd49c585d3494e1
	</view>
</template>

<script>
	export default {
		data() {
			return {
<<<<<<< HEAD
				id: 1,
				msg: 'hello',
<<<<<<< HEAD
<<<<<<< HEAD
				brandList: '',
=======
				newGoodList: [],
				searchVal: "",
				placeholder: "",
				hotGoodsList: []
>>>>>>> f3624e4f2fcf8612380565a3ad79c1665eda2cde
=======
				brotherCategory: [],
				currentCategory: [],
				name: ""
>>>>>>> e7bb3bf1d2aecfb5c269bc2293e70340a5828fb9
=======
				placeholder: '',
				searchVal: "",
				list: [],
				navbarList: []
>>>>>>> 399ef1c19967973891445c633fd49c585d3494e1
			}
		},
		// 小程序页面生命周期
		onLoad() {

		},
		onShow() {
			// 请求数据
			this.$request({
<<<<<<< HEAD
				url: 'index/index',

				successCb: (res) => {
<<<<<<< HEAD
					// 在这里处理数据
					console.log(res)
<<<<<<< HEAD
					this.brandList = res.brandList
					console.log("this.brandList", this.brandList); //获取品牌制造商这里的数据

=======
					// let {
					// 	newGoodList
					// } = res
					this.newGoodList = res.newGoodsList
					this.hotGoodsList = res.hotGoodsList

					console.log("新品数据:", this.hotGoodsList)
>>>>>>> f3624e4f2fcf8612380565a3ad79c1665eda2cde
=======
				url: 'goods/category',
				data: {
					id: 1005000
>>>>>>> e7bb3bf1d2aecfb5c269bc2293e70340a5828fb9
=======
					this.list = res.banner
					this.navbarList = res.channel
>>>>>>> 399ef1c19967973891445c633fd49c585d3494e1
				},
				method: "GET",
				successCb: (res) => {
					let {
						brotherCategory,
						currentCategory
					} = res
					this.brotherCategory = brotherCategory
					this.currentCategory = currentCategory
					this.name=brotherCategory[0].name
					console.log(this.brotherCategory);
					console.log(this.currentCategory);
				}
			})
<<<<<<< HEAD
		},
<<<<<<< HEAD
		onShow() {
=======

>>>>>>> 399ef1c19967973891445c633fd49c585d3494e1
			// 对象解构的默认值
			let {
				x = 3, // 当解构的对象中x严格等于undefined的时候默认值生效
					y
			} = {}
			console.log(x, y)

			// 函数参数默认值 当参数为undefined的时候生效
			function f(a = 'hello') {
				console.log(a)
			}
<<<<<<< HEAD
			f()
=======

>>>>>>> f3624e4f2fcf8612380565a3ad79c1665eda2cde


		},
=======
		onShow() {},
>>>>>>> e7bb3bf1d2aecfb5c269bc2293e70340a5828fb9
		methods: {
			onClick() {
				uni.navigateTo({
					url: '/pages/goodsList/goodsList'
				})
			},
			toA() {
				uni.navigateTo({
					url: '../a/a'
				})
			}
		}
	}
</script>

<style lang="scss">
<<<<<<< HEAD
	.center {
		text-align: center;
	}

	.center_word {
		font-size: 40rpx;
	}

	.brand_body {
		display: flex;
		flex-wrap: wrap;
		padding: 0 8rpx;
	}

	.brand_manufacturers {
		position: relative;


	}

	.brand_manufacturers_word {
		position: absolute;
		z-index: 1;
		left: 20rpx;
		top: 20rpx;

	}

	.brand_manufacturers_price {
		position: absolute;
		top: 70rpx;
		z-index: 1;
		left: 20rpx;
		color: #8b0000;
	}

	.brand_manufacturers_img {
		padding: 0 2px;

		image {
			width: 48vw;
			height: 190rpx;
		}

	}

	.box {
		color: $uni-color-primary;
	}

	.navBar {
		display: flex;
	}

	.grid-text {
		font-size: 28rpx;
		margin-top: 4rpx;
		color: $u-type-info;
	}

	.bottom {
		position: fixed;
		right: 0;
		// bottom: var(--window-bottom); // 如果是定位，需要考虑tabBar的占位 --window-bottom:tabBar的高度，是一个变量

		/* #ifdef MP-WEIXIN */
		bottom: 0;
		/* #endif */

		/* #ifdef H5 */
		bottom: 50px;
		/* #endif */
=======
	h4 {
		text-align: center;
		font-size: 40rpx;
>>>>>>> e7bb3bf1d2aecfb5c269bc2293e70340a5828fb9
	}


	.newgoodslist {
		margin-bottom: 20px;

		.now {
			text-align: center;
			font-size: 18px
		}
	}

	.new {
		margin-top: 20px;
		width: 750rpx;
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;


		.new-in {
			width: 350rpx;
			text-align: center;
			display: flex;
			flex-direction: column;
			// flex: 1;
		}

		.img {
			display: inline-block;
			// border: 1px solid #000;
			width: 350rpx;
		}

		.name {
			margin-bottom: 10rpx;
		}

		.price {
			color: #971819;
		}
	}

	.hot {
		text-align: center;
		font-size: 18px
	}

	.hotGoodList-a {
		margin-top: 10px;
		display: flex;
		background-color: #fafafa;



		.img {
			width: 200rpx;
		}

		.bb {
			margin-left: 10px;
			margin: auto;
			padding: 0 10px;
		}
	}
</style>
